package com.hd.hdxgddtools.mybatis.config;

import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
import lombok.Data;

@Data
public class StrategyConfig {
    private boolean capitalMode;
    private boolean skipView;
    private String naming = "nochange";
    private String columnNaming = "nochange";
    private String[] tablePrefix;
    private String[] fieldPrefix;
    private String superEntityClass;
    private String[] superEntityColumns;
    private String superMapperClass;
    private String superServiceClass;
    private String superServiceImplClass;
    private String superControllerClass;
    private String[] include;
    private String[] exclude;
    private boolean entityColumnConstant;
    private boolean entityBuilderModel;
    private boolean entityLombokModel;
    private boolean entityBooleanColumnRemoveIsPrefix;
    private boolean restControllerStyle;
    private boolean controllerMappingHyphenStyle;
    private boolean entityTableFieldAnnotationEnable;
    private String versionFieldName;
    private String logicDeleteFieldName;

    public com.baomidou.mybatisplus.generator.config.StrategyConfig toStrategyConfig() {
        com.baomidou.mybatisplus.generator.config.StrategyConfig config = new com.baomidou.mybatisplus.generator.config.StrategyConfig();
        config
                .setCapitalMode(this.capitalMode)
                .setSkipView(this.skipView)
                .setNaming(NamingStrategy.valueOf(this.naming))
                .setColumnNaming(NamingStrategy.valueOf(this.columnNaming))
                .setTablePrefix(this.tablePrefix)
                .setFieldPrefix(this.fieldPrefix)
                .setSuperEntityClass(this.superEntityClass)
                .setSuperEntityColumns(this.superEntityColumns)
                .setSuperMapperClass(this.superMapperClass)
                .setSuperServiceClass(this.superServiceClass)
                .setSuperServiceImplClass(this.superServiceImplClass)
                .setSuperControllerClass(this.superControllerClass)
                .setInclude(this.include)
                .setExclude(this.exclude)
                .setEntityColumnConstant(this.entityColumnConstant)
                .setEntityBuilderModel(this.entityBuilderModel)
                .setEntityLombokModel(this.entityLombokModel)
                .setEntityBooleanColumnRemoveIsPrefix(this.entityBooleanColumnRemoveIsPrefix)
                .setRestControllerStyle(this.restControllerStyle)
                .setControllerMappingHyphenStyle(this.controllerMappingHyphenStyle)
                .entityTableFieldAnnotationEnable(this.entityTableFieldAnnotationEnable)
                .setVersionFieldName(this.versionFieldName)
                .setLogicDeleteFieldName(this.logicDeleteFieldName);
        return config;
    }

}
